home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / SWAG9605.DDD / 0001_Nice page scroller.pas next >
Encoding:
Pascal/Delphi Source File  |  1996-05-31  |  1.5 KB  |  111 lines

  1. unit scroll;
  2.  
  3. INTERFACE
  4.  
  5. procedure scroff(const soffset:word);
  6. procedure vfine(const y:byte);
  7. procedure vait;
  8. procedure smooth;
  9. procedure scrpage(const p1,p2:byte);
  10.  
  11. IMPLEMENTATION
  12.  
  13. procedure scroff(const soffset:word); assembler;
  14. asm 
  15.   mov dx,03dah
  16. @W1:
  17.   in  al,dx
  18.   test al,8
  19.   jnz @W1
  20.   mov dx,03d4h
  21.   mov bx,soffset
  22.   mov ah,bh
  23.   mov al,00ch
  24.   out dx,ax
  25.   mov ah,bl
  26.   inc al
  27.   out dx,ax
  28.   mov dx,03dah
  29. @W2:
  30.   in  al,dx
  31.   test al,8
  32.   jnz @W2
  33. end;
  34.  
  35. procedure vfine(const y:byte); assembler;
  36. asm
  37.   mov dx,03dah
  38. @W2:
  39.   in  al,dx
  40.   test al,8
  41.   jz  @W2
  42.   mov dx,03d4h
  43.   mov ah,Y
  44.   mov al,8
  45.   out dx,ax
  46. end;
  47.  
  48. procedure vait; assembler;
  49. asm
  50.   mov cx,1
  51.   mov ax,250
  52.   @@l1:
  53.     @@l2:
  54.     dec ax
  55.     jnz @@l2
  56.   dec cx
  57.   jnz @@l1
  58. end;
  59.  
  60. procedure smooth;
  61. var a,i:word;
  62. begin
  63.   for i:=0 to 25 do
  64.   begin
  65.     scroff(i*80);
  66.     for a:=0 to 15 do
  67.     begin
  68.       vfine(a);
  69.       vait;
  70.     end;
  71.   end;
  72.   for i:=25 downto 0 do
  73.   begin
  74.     scroff(i*80);
  75.     for a:=15 downto 0 do
  76.     begin
  77.       vfine(a);
  78.       vait;
  79.     end;
  80.   end;
  81. end;
  82.  
  83. procedure scrpage(const p1,p2:byte);
  84. var a,i:word;
  85. begin
  86.   if(p1<p2)then
  87.   begin
  88.     for i:=(p1*25)to(p2*24)do
  89.     begin
  90.       scroff(i*80);
  91.       for a:=0 to 15 do
  92.       begin
  93.         vfine(a);
  94.         vait;
  95.       end;
  96.     end;
  97.   end else
  98.   begin
  99.     for i:=(p1*24)downto (p2*24)do
  100.     begin
  101.       scroff(i*80);
  102.       for a:=15 downto 0 do
  103.       begin
  104.         vfine(a);
  105.         vait;
  106.       end;
  107.     end;
  108.   end;
  109. end;
  110.  
  111. end.